package net.ericaro.neojavagen.blocks;

/**
 * <b>TryCatchFinallyStatement</b> ::= "try" <{@link net .ericaro .neojavagen .blocks .Block Block}> <{@link net .ericaro .neojavagen .blocks .Catches Catches}
 * >? "finally" <{@link net .ericaro .neojavagen .blocks .Block Block}>
 * 
 * @author eric@ericaro.net
 */
public class TryCatchFinallyStatement extends net.ericaro.neojavagen.JavaPartComposition {
	private net.ericaro.neojavagen.blocks.Block block1;

	private net.ericaro.neojavagen.blocks.Block block2;

	private net.ericaro.neojavagen.blocks.Catches catches;

	public TryCatchFinallyStatement(net.ericaro.neojavagen.blocks.Block block1, net.ericaro.neojavagen.blocks.Block block2) {
		this.block1 = block1;
		this.catches = null;
		this.block2 = block2;
	}

	public TryCatchFinallyStatement(net.ericaro.neojavagen.blocks.Block block1, net.ericaro.neojavagen.blocks.Catches catches, net.ericaro.neojavagen.blocks.Block block2) {
		super();
		this.block1 = block1;
		this.catches = catches;
		this.block2 = block2;
	}

	public net.ericaro.neojavagen.blocks.Block getBlock1() {
		return block1;
	}

	public net.ericaro.neojavagen.blocks.Block getBlock2() {
		return block2;
	}

	public net.ericaro.neojavagen.blocks.Catches getCatches() {
		return catches;
	}

	public void setBlock1(net.ericaro.neojavagen.blocks.Block block1) {
		this.block1 = block1;
	}

	public void setBlock2(net.ericaro.neojavagen.blocks.Block block2) {
		this.block2 = block2;
	}

	public void setCatches(net.ericaro.neojavagen.blocks.Catches catches) {
		this.catches = catches;
	}

	@Override
	public java.lang.String toString() {
		return print("try", block1, catches, "finally", block2);
	}
}
